/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package rn;


import beans.Mail;
import java.util.List;
import util.DAOFactory;
import util.InterfaceHibernateDAO;

public class MailRN {
    
    private final InterfaceHibernateDAO<Mail> mailDAO;
    
    public MailRN(){
        this.mailDAO = DAOFactory.criarMailDAO();
    }
    
    public void salvar(Mail email){
        this.mailDAO.salvar(email);
    }
    public List<Mail> listar(){
        return this.mailDAO.listar();
    }
    public void atualizar(Mail email){
        this.mailDAO.atualizar(email);
    }
    public void merge(Mail email) {
        this.mailDAO.merge(email);
    }
    public void excluir(Mail email){
        this.mailDAO.excluir(email);
    }
    public Mail carregar(Integer codigo){
        return this.mailDAO.carregar(codigo);
    }
    public List<Mail> buscaPersonalizada(String atributo,String nomeBuscado){
        return this.mailDAO.buscaPersonalizada(atributo, nomeBuscado);
    }
}
